﻿using System;
using System.Collections.Generic;

#if !SILVERLIGHT
using System.Windows;
#endif

using System.Windows.Controls;

#if SILVERLIGHT
using System.Windows.Interop;
#endif

namespace Songhay.Composition
{
    /// <summary>
    /// Demands that a Composition Host conform
    /// to <see cref="System.Windows.Controls.Page"/> Navigation.
    /// </summary>
    public interface INavigationCompositionHost
    {
        /// <summary>
        /// Gets or sets the composed pages.
        /// </summary>
        /// <value>The composed pages.</value>
        IEnumerable<Page> ComposedPages { get; set; }

        /// <summary>
        /// Converts the <see cref="String"/> into a page.
        /// </summary>
        /// <param name="typeName">Name of the type.</param>
        /// <returns>
        /// Returns a <see cref="System.Windows.Controls.Page"/>
        /// from among the composed pages.
        /// </returns>
        Page GetPage(string typeName);

#if SILVERLIGHT
        /// <summary>
        /// Gets the root visual
        /// of the Navigation application.
        /// </summary>
        /// <remarks>
        /// The conventional Application Loader uses Reflection to call this method.
        /// This call usually instantiates the Composition Host singleton,
        /// exposed as the static member <c>MefHost</c>.
        /// </remarks>
        UserControl GetRootVisual();
#endif

#if !SILVERLIGHT
        /// <summary>
        /// Gets the root visual
        /// of the Navigation application.
        /// </summary>
        /// <remarks>
        /// The conventional Application Loader uses Reflection to call this method.
        /// This call usually instantiates the Composition Host singleton,
        /// exposed as the static member <c>MefHost</c>.
        /// </remarks>
        Window GetRootVisual();
#endif

#if SILVERLIGHT
        /// <summary>
        /// Sets the Silverlight host.
        /// </summary>
        /// <param name="host">The host.</param>
        void SetSilverlightHost(SilverlightHost host);
#endif

    }
}
